//
//  SFTextField.swift
//  SeeFM_Swift
//
//  Created by CBCT_MBP on 2021/10/29.
//

import UIKit

class SFTextField: UITextField {

    var edgeInset: UIEdgeInsets?
    override func textRect(forBounds bounds: CGRect) -> CGRect {
        guard let ei = edgeInset else { return bounds }
        return bounds.inset(by: ei)
    }
    override func editingRect(forBounds bounds: CGRect) -> CGRect {
        guard let ei = edgeInset else { return bounds }
        return CGRect.init(x: bounds.origin.x, y: bounds.origin.y, width: bounds.size.width - ei.left - ei.right, height: bounds.size.height).inset(by: ei)
    }
}
